/*
 * Copyright (C) 2013 Daniel Wasilew <daniel.wasilew@codeminer.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.codeminer.parts.library;

import java.io.File;


/**
 *
 * @author Daniel Wasilew <daniel.wasilew@codeminer.org>
 */
public class Song extends DefaultIdentifiable {

    public static Song byName(String title) {
        return new Song(title, -1, -1, null);
    }

    public static Song byOId(long oid) {
        Song song = new Song(null, -1, -1, null);
        song.setOid(oid);
        return song;
    }

    public static Song byFile(File file) {
        return new Song(null, -1, -1, file);
    }

    private String title;
    private int trackNumber;
    private File file;
    private double duration;

    public Song(String title, int trackNumber, double duration, File file) {
        this.title = title;
        this.trackNumber = trackNumber;
        this.duration = duration;
        this.file = file;
    }

    public double getDuration() {
        return duration;
    }

    public void setDuration(double duration) {
        this.duration = duration;
    }

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getTrackNumber() {
        return trackNumber;
    }

    public void setTrackNumber(int trackNumber) {
        this.trackNumber = trackNumber;
    }
}
